<template lang="html">
    <div>
        <common-table :columns="columns" :data="data"/>
    </div>
</template>

<script>
import {
	getError
} from "@/apis/error";

import moment from "moment";
import CommonTable from '_c/CommonTable.vue'
export default {
    name: 'exceptionError',
	components: {
		CommonTable
	},
    data() {
        return {
            columns: [{
					title: '错误信息',
					key: 'message'
				},
				{
					title: '发生错误的脚本URL',
					key: 'source',
					width: '380'
				},
				{
					title: '行号',
					key: 'lineno',
					width: '80'
				},
				{
					title: '列号',
					key: 'colno',
					width: '80'
				},
                {
                    title: '发生时间',
                    key: 'createTime',
                    width: '170'
                }
			],
            data: []
        }
    },
    mounted() {
        getError()
        .then(res => {
            res.data.forEach(item => {
                item.createTime = moment(parseInt(item.createTime)).format("YYYY-MM-DD hh:mm:ss");
            })
            this.data = res.data;
        })
    }
}
</script>

<style lang="less" scoped>
</style>
